#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn = 100005;
const int maxm = 100005;
int n,m,frog[maxn],x[maxn],y[maxn],num_edge;
double dis,ans,longest;
int fa[maxn];

struct node{
	int from;
	int next;
	double dis;
	bool operator<(const node &b) const
	{ return dis < b.dis; }
}edge[maxm];

void add_edge(int from,int to,int dis){
	edge[++num_edge].from=from;
	edge[num_edge].dis=dis;
	edge[num_edge].next=to;
}

void init(){
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(i==j)continue;
			dis=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2));
			add_edge(i,j,dis);
		}
	}
}

int findf(int x)
{
	return fa[x] == x ? x : fa[x] = findf(fa[x]);
}

bool join(const int &u, const int &v)
{
	int f1 = findf(u), f2 = findf(v);
	if (f1 == f2) return false;
	else { fa[f1] = f2; return true; }
}



void kru(){
	int cnt=0;
	for(int i=1;i<=n;i++)fa[i]=i;
	sort(edge+1,edge+1+num_edge);
	for(int i=1;i<=num_edge;i++){
		const int &u=edge[i].from;
		const int &v=edge[i].next;
		if(join(u,v)){
			cnt++;
			longest=max(longest,edge[i].dis);
			if(cnt>=n-1)return;
		}
	}
}

int main(){
	cin>>m;
	for(int i=1;i<=m;i++)cin>>frog[i];
	cin>>n;
	int a,b;
	for(int i=1;i<=n;i++){
		cin>>x[i]>>y[i];
	}
	
	init();
	
	a=0;
	kru();
	for(int i=1;i<=m;i++){
		if(frog[i]>=longest)a++;
	}
	
	cout<<a<<endl;
	return 0; 
}
